package com.zhehekeji.opsys.api.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @ClassName TVoteSummary
 * @Description TODO
 * @author chenweiliu chenwei.liu@163.com
 * @date 2016-4-18   下午4:52:55
 */
@Entity
@Table(name="t_vote_summary")
public class TVoteSummary implements java.io.Serializable{

	/** 
	* @Fields serialVersionUID : TODO
	*/ 
	private static final long serialVersionUID = 4717601934755698439L;
	private Long id;
	private String playerCode;
	private String playerName;
	private Integer voteYear;
	private Integer voteMonth;
	private Integer votes;
	private Integer votesOther;
	private Integer votesTotal;
	private Date sumTime;
	private Long cpCode;
	private TVoteGame tvoteGame;
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="ID",length=20,nullable=false,unique=true)
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@Column(name="PLAYER_CODE",length=64,nullable=true)
	public String getPlayerCode() {
		return playerCode;
	}
	public void setPlayerCode(String playerCode) {
		this.playerCode = playerCode;
	}
	@Column(name="PLAYER_NAME",length=128,nullable=true)
	public String getPlayerName() {
		return playerName;
	}
	public void setPlayerName(String playerName) {
		this.playerName = playerName;
	}
	@Column(name="VOTE_YEAR",length=8,nullable=true)
	public Integer getVoteYear() {
		return voteYear;
	}
	public void setVoteYear(Integer voteYear) {
		this.voteYear = voteYear;
	}
	@Column(name="VOTE_MONTH",length=2,nullable=true)
	public Integer getVoteMonth() {
		return voteMonth;
	}
	public void setVoteMonth(Integer voteMonth) {
		this.voteMonth = voteMonth;
	}
	@Column(name="VOTES",length=11,nullable=true)
	public Integer getVotes() {
		return votes;
	}
	public void setVotes(Integer votes) {
		this.votes = votes;
	}
	@Column(name="VOTES_OTHER",length=11,nullable=true)
	public Integer getVotesOther() {
		return votesOther;
	}
	public void setVotesOther(Integer votesOther) {
		this.votesOther = votesOther;
	}
	@Column(name="VOTES_TOTAL",length=11,nullable=true)
	public Integer getVotesTotal() {
		return votesTotal;
	}
	public void setVotesTotal(Integer votesTotal) {
		this.votesTotal = votesTotal;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="SUM_TIME")
	public Date getSumTime() {
		return sumTime;
	}
	public void setSumTime(Date sumTime) {
		this.sumTime = sumTime;
	}
	@Column(name="CP_CODE",length=20,nullable=true)
	public Long getCpCode() {
		return cpCode;
	}
	public void setCpCode(Long cpCode) {
		this.cpCode = cpCode;
	}
	@ManyToOne(cascade=CascadeType.REFRESH,fetch=FetchType.EAGER,optional=true)
	@JoinColumn(name="VOTE_ID")
	public TVoteGame getTvoteGame() {
		return tvoteGame;
	}
	public void setTvoteGame(TVoteGame tvoteGame) {
		this.tvoteGame = tvoteGame;
	}
	
}

